package com.tang.mybatis.session.defaults;

import com.tang.mybatis.session.Configuration;
import com.tang.mybatis.session.SqlSession;
import com.tang.mybatis.session.SqlSessionFactory;

/**
 * @author Tang
 * @classname DefaultSqlSessionFactory
 * @description [  ]
 * @date 2022/4/6 16:00
 */
public class DefaultSqlSessionFactory implements SqlSessionFactory {

    private Configuration configuration;

    public DefaultSqlSessionFactory(Configuration configuration) {
        this.configuration = configuration;
    }

    @Override
    public SqlSession openSession() {
        return new DefaultSqlSession(this.configuration);
    }
}